class MemberInfoResponse {
  final int code;
  final String msg;
  final Member data;

  MemberInfoResponse({
    required this.code,
    required this.msg,
    required this.data,
  });

  factory MemberInfoResponse.fromJson(Map<String, dynamic> json) {
    return MemberInfoResponse(
      code: json['code'],
      msg: json['msg'],
      data: Member.fromJson(json['data']),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'code': code,
      'msg': msg,
      'data': data.toJson(),
    };
  }
}

class Member {
  String username;
  String mobile;
  bool isVip;
  String expiredDate;

  Member({
    required this.username,
    required this.mobile,
    required this.isVip,
    required this.expiredDate,
  });

  factory Member.fromJson(Map<String, dynamic> json) {
    return Member(
      username: json['username']??"",
      mobile: json['mobile']??"",
      isVip: json['isVip']??false,
      expiredDate: json['expiredDate']??"",
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'username': username,
      'mobile': mobile,
      'isVip': isVip,
      'expiredDate': expiredDate,
    };
  }

  static Member init() {
    return Member(username: "", mobile: "", isVip: false, expiredDate: "");
  }
}